<?php
namespace backend\controllers;

use Yii;
use yii\web\Controller;
use backend\models\ImgsForm;
class UploadController extends BaseController{
    public $nodeName = '上传管理';
    public $init_upload_image = '/common/uploads/system/upload.jpg';

    public function init(){
        parent::init();
    }

	public function actionUploadBox(){
        $filesInput = new ImgsForm();
        $filesInput->scenario = 'upload';

        if(Yii::$app->request->isPost){
            Yii::$app->response->format = yii\web\Response::FORMAT_JSON;
            return $imgs = Yii::$app->upload->Upload($filesInput);
        }
        return $this->renderAjax('upload-box', ['model' => $filesInput]);
	}
}